Fixing major bug where classname passed to factory() was ignored!