Added debug control flag for debug printing to stdout.