Added #{bin}/ to test and tweaked inreplace to be more general

#{bin}/ before the binary name makes sure that Homebrew installed version is tested.