Fixing wrong index-out-of-range detection in List::removeAt.