Fix atlas locking bug