Add some nil checks
Fix stuff reported by golang lint
Move gpx namespace to separate field