db: fix a bug storing range lists