Corrected few major bugs.