Horrible bug fixed.

I saw this code by accident - `is not` is not good for this type of comparison.