Fix error and warning IDs in diffmat() and cumsummat().

Also made some minor documentation and style fixes.