Rewritten IOProvider, bugfixes everywhere