Various kernel improvements