Add logging for the serial in question and fix potential null pointer dereference.