Fix incompatible declaration of fromJSON