Fix for the Darwin platform

@basdewachter Could you please test this on a Mac?