[db] handle missing metadata table

Fixes issue #164, hopefully.
[db] fix incorrect local
Merge pull request #166 from phi-gamma/master

fixes to v. 2.4, second iteration