Proper recompiling of the files with `--watch`. Fixes #842 and #1130