Bug fixes on parser