fixing scaling of mask closes #365