Fixed some port removal/addition bugs.