Discontinuous plotting fixed.

Small issue with critical sections.