Adjust lastIndexOf to match es6 spec