Added support for debug flag.