Fix bugs in GridPrior