Fix to allow choice of output data type and by value.