Fixed deployment issues

Some more issues were found in deployment and after recent merge.