Fixes #6096. Biggest fix ever.
Merge pull request #6276 from faerindel/CE_door_duped_fix

Fixes #6096.