Refactor #4308: Fix bug