small speed fixes