Re #8635. Added tests and fixed the bugs they exposed.

As per Russell's requests.
Merge branch 'feature/8635_kernel_strings' into develop