fixing some bugs on wirth parser