Better location handling (bugfix for broken links)