--- src/nsfns.m	2009-07-16 07:19:52.000000000 -0700
+++ src/nsfns.m	2009-07-29 23:07:28.000000000 -0700
@@ -1771,7 +1771,6 @@
 {
   check_ns ();
 #ifdef NS_IMPL_COCOA
-  PSFlush ();
 #endif
   /*ns_delete_terminal (dpyinfo->terminal); */
   [NSApp terminate: NSApp];
--- src/nsfont.m	2009-07-29 16:39:40.000000000 -0700
+++ src/nsfont.m	2009-07-29 23:05:27.000000000 -0700
@@ -238,7 +238,7 @@
 	    return w;
       }
 #endif
-    w = [sfont widthOfString: cstr];
+    w = [cstr sizeWithAttributes:[NSDictionary dictionaryWithObject:sfont forKey:NSFontAttributeName]].width;
     return max (w, 2.0);
 }
 
@@ -841,7 +841,7 @@
     /* set up metrics portion of font struct */
     font->ascent = [sfont ascender];
     font->descent = -[sfont descender];
-    font->min_width = [sfont widthOfString: @"|"]; /* FIXME */
+    font->min_width = [@"|" sizeWithAttributes:[NSDictionary dictionaryWithObject:sfont forKey:NSFontAttributeName]].width;
     font->space_width = lrint (ns_char_width (sfont, ' '));
     font->average_width = lrint (font_info->width);
     font->max_width = lrint (font_info->max_bounds.width);
@@ -1432,7 +1432,7 @@
 }
 
 /* NSGlyphStorage protocol */
-- (unsigned int)layoutOptions
+- (NSUInteger)layoutOptions
 {
   return 0;
 }
@@ -1442,9 +1442,9 @@
   return attrStr;
 }
 
-- (void)insertGlyphs: (const NSGlyph *)glyphs length: (unsigned int)length
-        forStartingGlyphAtIndex: (unsigned int)glyphIndex
-        characterIndex: (unsigned int)charIndex
+- (void)insertGlyphs: (const NSGlyph *)glyphs length: (NSUInteger)length
+        forStartingGlyphAtIndex: (NSUInteger)glyphIndex
+        characterIndex: (NSUInteger)charIndex
 {
   len = glyphIndex+length;
   for (i =glyphIndex; i<len; i++)
@@ -1453,8 +1453,8 @@
     maxGlyph = len;
 }
 
-- (void)setIntAttribute: (int)attributeTag value: (int)val
-        forGlyphAtIndex: (unsigned)glyphIndex
+- (void)setIntAttribute: (NSInteger)attributeTag value: (NSInteger)val
+        forGlyphAtIndex: (NSUInteger)glyphIndex
 {
   return;
 }
--- src/nsgui.h	2009-01-22 05:55:44.000000000 -0800
+++ src/nsgui.h	2009-07-29 22:54:19.000000000 -0700
@@ -134,7 +134,7 @@
 typedef struct _NSRect  { NSPoint origin; NSSize size; } NSRect;
 #endif
 
-#define NativeRectangle struct _NSRect
+#define NativeRectangle NSRect
 
 #define CONVERT_TO_XRECT(xr, nr)		\
   ((xr).x     = (nr).origin.x,			\

