Fix issue #9 with if statement