Fix inaccurate cycle counter