Fixed some code, changed some handles e.t.c.