fix broken test (watch on unreadable dir), tweak code, fix race in test