Fix potential thread conflict in lock() behavior
Rework excluder logic (#413)