Fix error string generation