fix minor bugs on parser