Fixes and cleanup for perf changes