minor bugfixes, added shapes clustering