Fix #4474

Still needs testing