Properly parse port spec