More reliable and complete build script
Merge pull request #2 from kerneis/master

More reliable and complete build script