Shm small fixes

Here are some of the changes I discussed with @mdesco on the mailing list.