#914, #1035: Improve identical validator, thanks to @jazzzz