TSAGE: Fix some obvious errors detected by Coverity in R2R