Fixed bug in gps sending

Fixed a bug in gps sending which caused pilot position and distance
calculations to be sporadic. Also did some cosmetic changes.