Switched to using safer string functions