Fixed document building and cache loading bugs.