Fix issue #2542 v40

Very same fix than the other ones in reference to #2542 but for V40