Improve tests and add some asserts