Mac fixes

Mac fixes... getopt should be done with an #ifdef I guess...