added support for clusters
remove compilation warnings