Added nullchecks when building result strings, and a test case to use them