Fixed math errors involving probability density phase and energy expectation values. Also cleaned up code.