better tests and small fix