Fix syntax error. Fix running in non-debug mode.
Fix bug when certtype not in config