Make reply handling more reliable