Some adaptations for mac