Fix fetch_database