Fixed validation
Code cleaning