Memory fix. Groups and Cubes should be collected properly