#32: Improved validation