Made get/set text a little more robust.