Mac OS X and Linux fixes