Fix most HLint warnings