Fixed handled message logging bug.

If a message was handled more than once, it would have been logged more
than once.