Fixes as per Mark's suggestions