Fix integrity check for context