Refactored aggregation protocol structures.
Added some checks.