#133 improve code and avoid warnings in macos