Fixed corner case for rfind