Fixed outputing error message in pgs file.