minor fixes to location handling