Format If statements to use blocks consistently

Also use elses properly rather than rechecking values.