Fix bug with leaking `IOSink`s
Fix url typo
Refactor apply method
Add InvalidDataException and print to log when it is raised