Fixed generated id extraction