Cleanup and bugfix location object