Gateway Bug fixes