Fixed $MONITOR_PORT detection, thanks choffmann