Now everithing should work as expected. One minor improvement in the error function for the factories.