Fixed some issues and added integration test for remove-port.