Yes, it appears the code will allocate enough memory for computing up to three mode couplings regardless of the requested level of mode coupling (hence the size of the array that was causing problems). I don't know the history of this module, so I'm not sure why it was implemented that way.