fix 2 bugs in post parser

Please help review my changes and merge to your main branch. The code is tested in my iphone 4 device