Fix bug in emoticon code that leads to an infinite loop if emoticon does not exist