Fix compilation error introduced in previous commit

Also take advantage of this and remove some warnings.

Change-Id: I0d4e7ed860f2881c00845eb9a06eea41ad85b4fc