Fix bugs in RenderingStatistics

Fix bugs in RenderingStatistics.
Add comments. Rearrange source files.