Minor changes in geolocation directive

This PR fixes the "double declaration" of a local variable, makes some code styling changes, and adds a missing semi-colon.

Please review and merge.