Fix "Not in scope" bug