Properly collect variables in map expressions in v3_core

@josevalim