Fixes some of the risk analyzer bugs