Fix database update error in file and repl