Fixed plotting bug