Fix gates drop bug reported by kaeza and Kacey, avoid polluting the global namespace.