Improved events, tests and documentation.