Some arec bug fixes; this also includes a lot of debug output for now. It will be removed later.