Tidies up whitespace and adds a missing else clause