FakeSMC key handling and memory management bugs fixes