Cast to string if field has maxlength value, closes #989