Fixed #6436 #5596 and added threaded initialization

svn path=; revision=84739