Fixed check of `NextVariable`'s return value.