Improving deserialization (we can now deal with [] instead of null. Fixing tests