Fix bug checking $1 from earlier scope - fixes #70