Improve repository tests and fix travis build.