Better fix for U4-5564 - replaces reverted part of Pull #492