Replace the patch from #1600 with the change that landed upstream. Signed-off-by: Chris Packham <judge.packham@gmail.com>