Fixed wrong behaviour of validator.