Created sentinels

These functions now immediately return 0 if they detect a problem, this
is done before  changing anything