fix bugs + tests + add debug + fix watch