Build scripts fixes