Fixed a bug in filename index validation