A bunch of changes for getting MR sessionization to work