Small bug fixes relating to port addition/removal