Adding NULL and bounds checks to progress.c