Fix argmax and comparison