More cleanup and fixes on migrations