Update validator.java

Fixed few small bugs with validation methods.