Core: Fix recursive merging of config values.

There was a bug when config keys with scalar values would end up
getting merged together in an array, breaking about every expectation
in the code. Now it should behave more properly.