fix protection bug, define R_previousSymbol
bug fix, more tweaking