make debug output better, re-fix inconsistent ref/branch param naming