Implemented substitution-matrix saving and made matrix loading somewhat more robust.