Improved validation context handling.