Fixed some bugs with radius and VM weight calculation.

* Also some optimizations.