Fixes a NPE in history reading.