Code inspections

Hi,
I ran some of the new code inspections in intellij idea across the code base and made some fixes.