Version 3.6.5 Fixes for Ruby 187 and mac os implementation