Fixing an issue in pileup generation and in the MdTag util. Also, adding test coverage.