jlogutil: fix errors, add tests