Fixed crash with unregistered gate IDs