Moved debug printouts to stderr.