Fix potential overflow when checking IDBEHOLDx