Fix some tests and revert some changes