Fix #7: Empty port handling