TMT_FIRSTINT and TMT_LASTINT are the same value here, so the error path would always be taken. Fix to check only that the values are outside the possible range.