fix old tests and add some new ones