fixed #2092: Make some function static.