bugfix: throw an exception when parsing has terminated but still characters are left