Code cleanup. Used slightly modified Google Style Guide.
Fixed error detection during alarm acknowledgement.