merged changes from 024073632a and 9a5898a74e. Fixes for db locking, syncing and dashboard startup