Brew fixes

Merged username-removed-5302 requested to merge brew_fixes into master