Some bugs in validate, changed method names to toString()