Fixed some errors in the gps functions