Fix web.config, refactor validation