Fix a bunch of compile errors

Change-Id: I6eb856566c75129816709bbbe8bc3fdcf31735fb