This re-introduces the fix that the filetype.lua refactor inadvertently reverted. The fix ensures that in the case when end_lnum is omitted, a string is always returned.