Fix more compiler warnings
Fix deadlock issues with type registry