Fixed TowerOfHanoi implementation.