Fix some bugs on Linux platforms.
Use travis-ci for testing.