Minor changes in fetch data function.