Fixed some Code Errors and General Code clean up.