Fixes delegate and factory bugs