Bug fixes for iteration 1 code