Fixed validator, improved str generator