Removed some global locks