Fixed bug with grid being modified