Added more input and output function error logging