Fixed with a simpler patch.
