Fixed Gateway Crash (for real) 

See commit for details.