Can't use deprecated commands module under Python 3
Fix these to work on both Python 2 and 3 unchanged