Fixes tests and factories