Fix db undefined

Quick fix.. If you don't specify leveldb, db is undefined in options and was throwing an error.