Corrected associations and fixed nesting of resources.