Fix NPE in load method