Fixed some crash bugs with formatting strings