Add Travis CI to project.
Fix seg fault error.