Simplify addVariable handling for const variables