Revert "Revert "wfd + some compilation fixes""

This reverts commit 17ccfef890e98fab3d63205f746c308e55ec98d8.