Fixes for Deadlock and sync/async issues