Fix some errors in machine state/cycle state