ENH: make build more robust