Fixed all the bugs