Add support for memory errors in Rivers memory model