ContainerBuilder: fix format statement of methods in factories [Fixes #977]