More reliable focusing checks

Fixes #2