Some fixes for Linux compatibility

One fix is a bug that should have affected everyone. The other is moving the BREW command into a darwin (OSX) section.