Fix JSON documentation

Fixed some errors and added usage of the `decode` function
Fix issues in libtest