Added hook to R-mode to make it behave a little better.