Fixed recursive element validation