improve output directory checking logic
fixed bug in config

If a configuration file was given then it was overwriting, not
appending to the default configuration. Furthermore if a key
was in the config file but not in the default config it would not
be used