Fix memory head corruption with large frames.