Bug fix

Some additional code was not properly tested and caused occassional errors for some users. Reconstructed code sequence for edit mentions.