Fix test directories, factories and deprecations