More fixes for #1 on Mac OS X, and a bug fix