Fixed parser creation, error reporting and grammar