Updates to fix homebrew script to make it more robust and easier to use.