made sync-nodes executeable
cleaned up debug code
corrections after shellcheck.net