Fixed defect#4 and defect#5