Compute config file paths properly

fixes #6564
fixes #6534