Reworking of RIV related stored procedures and programs for changes that were made by TR on 6/21/2013.