ref #2827: added Vika's tweaks
ref #2827: fix wrong schema-version in db after decrement, added increment and decrement features
dbwrite fix