Fixed spinning-lock bug