Ported cccb8 hooks. Many core changes