Threading improvements.