Fixed end marker bugs in checking routines