Fixed exit on Mac