Improve tests and add test