Changed config handling. More fixes needed..