Added mac portability stuff