Fixed hasInstance to return false if  is null