AutofacFactory improvements and fixes