Fix port parsing bug