fix constructors and NPE for inner read-only objects
fix constructors and NPE for inner read-only objects