0 when no perm/tempfail

Also fix documentation and trailing spaces