config: fix variable overriding

When two or more variables of the same name exist and the user asks
for a scalar, we must return the latest value assign to it.