Linux/OSX portability changes