fix repository tests + migration issues