Some bugfixes and new functionality for deferred loading