Deferred FileAPI unit tests, bug fixes