Made WS client Closeable. Misc cleanup.
Make sure the database reader doesn't fail if we add new keys to the database