Fixed plotting bug that caused crash on Macs, and other minor edits.