backport from trunk (rev #9991)

GRUU fixes for building & matching GRUUs
Credits to Tolga Tarhan