Fixes #4688

Or attempts to at least.