Fix tests and add them to Travis CI