WarningThis is a rescue attempt to get a piece of old code to work with modern R. FOR THE LOVE OF GOD don't use this.