fixed two problems with output to stderr