Avoid reintroducing #610, updates the fix to #804