Fix id generation