Part 1 - Fix bugs