minor tweaks ported from the hm3 repo
minor tweaks ported from the hm3 repo