Now possible to specify output directory. Bump version: r1. Fix filenaming bug (min/max)