Fix numerous problems with binary creation script