XD-1177: more error checking around labels and indexed modules