Improved perf fixes