Buildfixes, final pull

This is last patch set for build fixes.
I did some testing, only with STA mode. No noticeable regressions found. 
No more warnings in build log ;)