Some code cleanup.

More consistent declarations of if-statements and in use of the config
dict.