Change getAndIncrementValue logic to only do one if.