Fix an extra "end" statement in the factories definitions.