Fix bug on recount
Fix regression in private attachment saving