run_im3shape.py: fixed a couple of weighting/masking bugs