Merge pull request #496 from nicolas-raoul/unit-test-for-issue2907