Refactored a test, in order to be more robust.