Prevent error on localgpx.js. Fixes #1207