bug fixes in staterep artihmetic, updated docs