Correct error handling from the previous commit.