Minor patches to fix kernel compilation