fixed bugs in the O2 parser