Change id of latvar return variable to 'lat', which makes more sense
than the input variable's id.  Several other functions need a similar change.