Bugfix to crash in Gate.