         if result instanceof Factory
           result.initialize aOptions
         else if result
-          result = if isObject result then extend(result, aOptions) else aOptions
+          result = if isObject result then extend(result, aOptions) else if aOptions? then aOptions else result
           result = registeredObjects[aName] = createObject Factory[aName], result
         return result
       else

  class CustomFactory
    constructor: (aName, aOptions)->
      if aName instanceof Factory
        aName.initialize aOptions if aOptions
        return aName
      if isObject aName
        aOptions = aName

        if not aName
          # arguments.callee is forbidden if strict mode enabled.
          try vCaller = arguments.callee.caller
          if vCaller and isInheritedFrom vCaller, Factory
            aName = vCaller
            vCaller = vCaller.caller
            #get farest hierarchical registered class
            while isInheritedFrom vCaller, aName
              aName = vCaller
              vCaller = vCaller.caller
            aName = Factory.getNameFromClass(aName) if aName
