Move equality checks above done() calls