Added frame counter rollover detection.