Fix migrations and several other bugs for 1.0.x