Fixed regrid.c for 64 bit platforms