Added support for test mode.