Fixed if and code style