Various fixes to Core