Changed the handling of the AGI replies. Code and documentation updates.