Bug fix and Mac OS intergation