Bug Fixes for Deploy Code script