Corrected exception thrown during nested exception on ncubeFromJson and ...

...added appropriate test.