Fixed bugs in plaintext parsing