jevents: improve error handling
jevents: fix some error paths
jevents: some static analysis fixes