Fix issues with thread local extensions