Fixed compare to NULL warning