fix parsing of some uncommon cases