Fix and enable Hacking H501 warning

Enable Gating on H501. Fix the only two cases
that trigger.

Change-Id: Ib309b989df6556d7436e718e1497ce4dcacc83d6
Merge "Fix and enable Hacking H501 warning"