Fixed a bug where the error message was not filled if an empty object was passed to the json_pack. Fixes #271