OS X Compatibility #27

@DAlOG @AndreyMoskvin please check and confirm if all things are correct.