Fixed checkConditions when an expected value is supplied.

I ran into a bug when using this to test code that uses check conditions on putItem. If you supply an expected value it does not test for equality correctly, and it does not correctly perform the test if the optional exists flag is not set.