Better fix for U4-5564

Replaces reverted part of Pull #492