Made the use of sprintf safer.