Correction: failure on sharing when user ID was prefixed by zero

Backport of 51b727c from master