Parsing bugfix + tests