Added a missing 'end' line and removed an erroneous 'defaultto' definition to fix the cs_order type.