Fixed NPE for newly created db
Merge pull request #1 from Oregu/master

:alien: