Fixed most of the intialization issues.