because i thought they were the same, i don't see difference between them (and the code too, it appears - to me- the same)... but i'm not a code good boy...
Looking back through that code, the only odd thing I immediately see is in post.template.php ,
var count_attachments = ', count($context['current_attachments']) ,' + 1;
var count_attachments = ', count($context['current_attachments']) + 1,';
See if that makes any difference at all ... and remember
to put it back to the way it was or the MOD will not uninstall cleanly. So save a copy of the post.template.php before you start doing edits so you can get back to where you were.