Added more error checking when dealing with config options