Fix arguments passed to get_selected_gateway()

Closes: #3658