Fixed last set of bugs