Race fixes

Lot's of race fixes. WIP