Emit error on unexpected close
Bumped version to 0.3.22