Add counting of woken threads, fix typos and indentation.