Fix port check