Fix possibility of infinite recursion in factories.
Fix possibility of infinite recursion in factories.

TanayParikh/foam2,TanayParikh/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,TanayParikh/foam2,TanayParikh/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2