Updated mistral_mod.cpp from Emmanuel.