[Fix] Fix lock errors and empty slot counter