ZK now properly calculates how many bytes written