Fix some bugs on rhel6.