Merge code from Mac