Fix mhd.py for 3 dimensions