Silence Notices if string offset beyond end of string

When building the fragment to switch on, silence Notices arising from the
offset going beyond the end of the string.