Small bug fixes

Small bug fixes so that factories can now be loaded from the
configuration file in runtime.