Changed the if conditions to be more coding style conform.