[db] handle missing metadata table

Fixes issue #164, hopefully.
[db] fix incorrect local