fixed alignment and parsing of text field restrictions

@stowellm 
Found two bugs with text field restrictions in writer while I was fixing the other bugs. This fixes them.