rebase + fix last warnings

Rebased and fixed some additional warnings. builds and tests pass locally.