Minor bug fixes, grid bug  fix