Avoid anonymous compound in add_shortcut (fixes: #3742)