Made real-time plot more robust to scripting errors.