Refactor tests to pass Travis.