I know this is considerably more than TeX but it seems to be needed.
Long-standing grid bug fix.