Fix for mac os compilation and tests issues