Handle non-string inputs in stringify