Fix build and deployment scripts