     # @return [Object] JSON Schema
     #
     postprocess: (data) ->
-        @processRules(data)
+        @cleanRefs()
+        @processRules(data, __path: '#')
+        @processTypeReferences()
 
     #
     # Converts enumeration into JSON Schema object definition.


        # New enumeration definition
        enumeration =
            type: 'array'
            title: enumeration.title
            elements: elements
            minItems: elements.length
            maxItems: elements.length
            destructuredTo: $ref: "definitions/#{destructuredClassTitle}"

        # Add class to definition to local definitions
        @processDefinition(klass, enumeration)

        # Add enumeration to context
        utils.addAsObjectMember(ctx, 'definitions', enumeration.title, enumeration)

        ctx


        # Add class to context
        utils.addAsObjectMember(ctx, 'definitions', klass.title, klass)

        # Register type definition for later referencing
        @registerDefinition klass

        # Return context
        ctx

