Fix infinite loop with words greater than 80 characters in write_message. Closes #196 on github.