Removed some debugging code
Added configurable ppm_error setting, and gain.