Fix implementation of `min3`