Fixed assignment to *error that could be nil