Fixed build script

Fixes #380