Bug fixes with getting correct reward