Fix port parsing in Monitor.