Fix bugs in using switching to new database

Signed-off-by: Tod Fitch <Tod@FitchDesign.com>