A utility static method providing a general solution to #1055 could be reused to solve this bug as well.