Fixes for DB issues