small fixes found with respect of JetBrains ReSharper 8.0.2

Hi Tony,

I included in the pull request some small fixes found mostly with respect of JetBrains ReSharper 8.0.2.

Best regards
Oleg