Fixed issue where map filename was sometimes incorrect

Fixed issue where sourcemap file would sometimes have the incorrect URL and therefore could not be recognized by the browser.