Why return nil in an error case?