Config improvements

This improves config handling.