Fixed some minor issues with world coordinates

Error in calculating world coordinate with atan2 was fixed, pluss some
cleanups