This fixes a double logging of build elements.
The fix is taken from !586 (merged) and adapted on the new code.
Changes proposed in this merge request:
This merge request, when approved, will close issue/bug: #507 (closed)