GPS: Various fixes for the test_gps utility

Fixes bugs in GPS interaction.