Fix issue where versions could be appended to versioned ids in history