Made debugging optional and an option that can be enabled in the config file.