Go vet

Cleaned up issues raised by go vet (they were real).  Note that I change tmp to tmp_fn for consistency.