Fixed most of the issues