Added support for mode=debug when building.