Added support for minctoraw; general tidyup.