Fixes #1663, multiple gates near one handle work correctly