Prevent errors when last_element is a number.

In cases where last_element is a number (users.update or tickets.update) a fatal error will be thrown when trying to call indexOf().  This ensures that the URL last_element is converted to a string before calling indexOf() which will ensure this doesn't fail.