Corrected a bug related to grid layout.

Enabled parent changing without breaking everything.