Working script sans publish

Various catches fixed