bug fixed for migrate and fixed #141
Merge branch 'master' into dev