Bug-fixes after changing to a write-based parsing