Added document info to 2dplots and fixed some bugs caused by edge cases.