Fix and speed up travis-ci build.