Make test more generic.

This fixes failure issues in travis.ci.