Simplified matrix math in calc_pH.

Removed excessive transposing when combining matrices.