Add profiling for rebuild storage feature.
Fixed some bugs in rbs.c.