Code style improvement

Using "if not total:", although technically correct, is confusing
when an integer is expected, and makes code maintenance more difficult.
Replace with "if total == 0:" which is easier to understand.

Change-Id: I5571600cf180bca7c700f2ada148dbd580b25250