Added platform-specific main function (for Mac).