a minor error handling tweak and go fmt fixes