Creating output directories properly.