Fixing deprecation warning about AS to_json; fixes #16