Added gauge/pot auto-calibration.

Also fixed indentation.