Improved validation
Merged from main repository