Fix bug in plot script.