Merge "Add op count check before attempting to write operations" into main