OC-10077: Port CHEF-4419 fix to be included in 11.8. 

Also fix an annoying warning while running specs on windows.