fix some problems with detecting directory changes, add support for files that are removed while monitor is not running