fixed residual computation
fixed small bugs in addition of RowPartitionedMatrix