Various bugfixes

Mostly fixes related to dbInit update