Tweak scripts for computing mutual information

These mostly provide performance fixes