Improved multidb handling.