Fixes compilation, adds threads again