New tests and small changes