Fix bug I introduced in ascii.py that is only hit when writing p.  

Also modify a test so that it would
detect this kind of bug in the future.