Fixed some bugs with database path