Fix NPE caused by inproper load ordering using JSON

fixes #5