fixed bugs in value iteration agent