#398 Fix problem with exporting database.