Fixed debug build; someonee please review these changes. (nw)