Couple of fixes/improvements to mint script