Amended lastIndexOf() to accept null as first argument