Fixed last bunch of bugs