Bug fixes in task 2