Fix id not returned
Fix sign-compare warning
Do not print directly, return formatted string instead. Also rename it to 'to_string'