Wip jcsp misc

General purpose small changes spun off from wip-mds-sessions branch.