Version 4: adds stub_load_singleton_resource.