Added logging for more useful error messages

the only message returned by the output stream when passed a null arg is "null".  this should provide better debugging/error trapping