Implement correct handling of variable binding