Fixes queue lock/unlock