Change structure of if-statement to silence compiler warnings
Removed extra parenthesis in if condition
Add return value for default case