Gateway Bug Redux (develop)  

This is the develop version of #493