Updated patch for MDL-37733. Moved the logic inside the checker function.