Added plotting functions and fixed a bug in PhaseTensor