Changes for Mac Os X compatibility