Fix some small bugs: hung up on closing of grid mode editing window