Fixed some errors with the computation.