Fixes for the new DB infrastructure