Fixed a bug in the CRN code