Putting Graham's fixes back in