Fix #1672 by patching in #2084