HLint suggestions, and some changes to select function