Bug and typo fix