Fixed some test cases for RiskLogic and added viewer state.