FIXED: out-of-bounds error in RCM