Added debug patches and misc updates