Error checking for previous commit

Don't want the thing crashing!