Make notEmpty more robust