Yes, my fix is wrong here. It shouldn't assume that the configuration file is in the data directory. I'm not confident that my changes preserve the current behavior in all edge cases, which is also why I haven't merged this yet. It's getting too complex. It may be better to document the behavior that we want, create test cases, and redesign the datadir handling according to that.