fix a bug in calculating common cells, fixes #19
fixes indices of dimensional variables