lib: js: deserialization fixes