CLOUDIFY-1589 Misc fixes to debug scripts subsystem