fix-120, fix-121 and code merge up of mac and windows versions