Fix setting attributes for Kernel objects