Fixed some of the issues, final debugging