Avoid memory leak caused by reuse of `elements` constant as local

The `elements` variable was used as a constant at the closure level, but
then it was also being assigned in functions attempting to use it as a
local. This capitalizes all closure-scoped be constants to avoid this in
the future.
2.0.2