Fix CodeSniffer errors and warnings

Change-Id: I442b4e55521089ab64b049c8087985af202515dd