Better location handling (bugfix for junibreh)