Fix calling  in  anonymous function to set locale and cache, fixes issue #108