Write debugging output to stderr (#1059)