Handle nil properly