Fixed history, improved tests.