Mac fixes

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