Added tests and other helpers.