Problems with lambdas and references