Fix some compilation warnings

Mostly by adding curly brackets to if statements that needed them.