Fixed unsafely dereferenced calls to .text() in functional tests.