Fixed wierd if-statement evaluations.

Signed-off-by: Lucas Arnström <lucasarnstrom@gmail.com>