Improve capacity ratio and fix bug