Fixed some memory leaks and semantic issues
Failed writes now reports whatever is on stderr.
Don't paste read only tags fixing #63