final fixes from yue shi