PEP8 and pyflakes corrections
Add tests for all validator functions and fix a bug in one of them