Final bug fixes for new DB upgrade system