bugfix -- NULL can't be used for equality test