Fixed tests failing in DebugMode