Some fix, more optimization