Replaced some heap arrays with stack ones.