Allow setSelection() to have optional end argument, since some existing code uses it that way