Migration, and fix tests