Fix a bunch of GCC errors

Change-Id: I7a80957e60fa8a1bc2cb766fbf70000a1f67513f