Fixing errors in cmds arrays