CRA-700, CRA-704

Reverted grid padding changes and some bug fixes of memory leaks