Python 3 fixes to change directory command. Add some comments too.