Fixed a bug causing incorrect pH calculation.