Bug hang auto correct

fixes #871