Some fixes - attached.
Created attachment 198034 [details, diff] files patch
Created attachment 198049 [details, diff] ebuild
applied, thanks
required for interix too! note added to ebuild