Fix checking for None