Some refinement checking stuff.