Fixes #1 by improving the check with the right context.