Update directory and global caches, fix WhenError.