fix evaluation of integers in if statements

also added a unit test, fixes #15