Added code to process replies.