Renamed on_error to error_score and made some other changes based on feedback from discussion on GitHub.