database and mongodb fixes for next versions