Fix problem with unmarshalled resources

Calling methods on the loaded resource would raise `NoMethodError: undefined method attr_accessor for nil:NilClass`.