tidied up default config fallback and debug mode