Fixes in build script. Added versioning.