Fix some golint warnings; some code clean-up