Commit cb239e60 introduced artifacts when using the smudge tool with multithreads. Fix this (caused by a wrong offset passed to an iterator) plus indentation fixes.