Handling race conditions and typos