Fix bugs, output more stats.