Fixed validation for NilClass