fixing trackWeights (mis)usage and couple of other performance issues