Add and use rs_debug() instead of fprintf to stderr.