fixed #1643 fixed bug for indexOf to lastIndexOf

fixed bug for indexOf to lastIndexOf