Updated build script to work better with TeamCity.