Fix lock order violations