fixes for darwin