Handle undef correctly