Unit test fixes and debug setting fix