Fix bug on smart-expand.