Reset mElement when completing a line loop (thanks Hugh)