Fixed a bug where the localport and remote ip were incorrectly set