Thanks for the bug report. Is the bug reproducible? Does the attached patch fix it? Sorry, I don't use OS X, so I can't easily test this fix.