Fix for scope checking