Fixed bug in index check with vp~