Fixed relative path in db open
Added a bunch of debug bs to globals