fix some bug reported by TravisCI