Workaround Firefox "no element found" bug

See https://bugzilla.mozilla.org/show_bug.cgi?id=884693

Fixes #468