Fix plotting bug