Minor Fixes to test factory