Moved check_cmd() to PyUtils