fixed bugs in aggregation if no bottom layers or if only one top layer

- new sw_v27 version