Various core fixes