Fix two if statements to be more idiomatic.
Change formatting for consistency.