Fix a problem in the test which caused in some case a crash (thanks to Philippe)