Fixed bug in remap hosts function