Fixed most of the warning errors