fixed out/err in deploy & plugged main unit tests to pre_publish