Merge Linux changes into OS X.  All tests passing.