Add output support and solve most of the crashy stuff on OS X