Some suggestions about the code

Hi,

I just made some commits that are four standalone suggestions. Please ignore or cherry-pick any of them.