db: Fix #668