Bug fixes for db move