Fixes #5796

Fixes #5796