[IOT-1604] Fix cloud routing code