Fix incorrect if test

Fixes #102