Fix bugs and change database URI