Build err v2

Fix various build errors. Updated to address Greg KH's comments.