Several points not respecting our coding conventions here (space in if condition, else not in the same line as the if closing brace)