Added another check for errors.