Added some support for debug flag.