Fixed NPE when passing nested objects