Bug fixes for Homework 6.