Fix remove scope bug. Fixes #7