Register messages.
Add debugging.