fixes for -legacy and kernel includes

Change-Id: Ic3df22bea759ca68780c74ab7215b77162939fb4