*sz4: more fixes and unit tests