Thread improvements and documentation changes