More (minor) db query cleanup.