Fixed issues with JSON referencing