fix ordering of results from queryMoreTrips

also removes leftover debug code, fixes a bit of code style and correctly handles invalid location inputs.