Fixes reading gateway settings from stdin.