Fixed most of debug errors.