Better checking for codap main documents