Fix error in conversion check
Fixes issue #187