closed #3861, fixed some typo and indent problem