Properly convert errors to strings