Fix openDatabase() calls after printing