Given the adjustment above to the define for 'error_class', this could be simplified to just:

    class="field ${error_class} ${css_class}