Improvements for RET and M-RET, + bug fixes.