Fix database URI generation.