FIX: corrected some comparisons to None