Added directory selection button and TMS option for masks.