Add and fix core tests