Fixed select_min()
Fixed decode issues