Linux and Mac OS X compilation fixes;