Fixed an NPE when building revision histories