Added NULL checks and some debug output to the

command processor. It think we're running out of memory after a few
messages. Don't know where, yet.