Fix some serious logical flaws in Config System.

They were causing NPE's