Fixes #129: internal state of custom StringScanner is now correctly reset