Correct undefined variables in validator.py and wrong indentations