Fix tests and asserts