Fix faulty behavior of command counts