Started adding thread support.