Fixed bug where gates with no exit did cause an exception.