Misc fixes to toStr and other functions (HYP-302 issue)